﻿using System;
using System.Threading;

namespace time
{
    internal class Thread2
    {
        public static void work()
        {
            Thread2 c4 = new Thread2();
            Thread nt = new Thread(new ThreadStart(c4.display));
            nt.Start();
            c4.display();
        }

        private void display()
        {
            lock (this)

                for (int i = 1; i < 10; i++)
                {
                    Console.WriteLine(i);
                }
        }
    }
}